package com.yuexia.yxim.client.client;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @Author: yue_xia
 * @Date: 2020/6/5 7:30 下午
 */
@Configurable
@SpringBootApplication
@EnableAutoConfiguration
@ComponentScan("com.yuexia.yxim.client")
public class ClientApplication {
    public static void main(String[] args) {
        //初始化spring
        ConfigurableApplicationContext context =
                SpringApplication.run(ClientApplication.class, args);

        CommandController commandController =
                context.getBean(CommandController.class);

        commandController.initCommandMap();

        try {
            commandController.startCommandThread();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
